;Set the keyboard to NATURAL mode ( -nat) for GameBase sendkeys to work.
;Once the game has loaded chage the keyboard mode to EMULATED, for games that require it.
;e.g. CHUCKIE EGG (keys game), Joystick controlled games should be unaffected in NATURAL mode.

;a few game disks have copy protection, these disks do not work in MAME yet.
;they may boot but have the KEYBOARD input disabled.
;They do work on REAL machines according to info on-line???.

If Key_mode CONTAINS(basic)
	;Auto Boot XTAL BASIC in Drive 0, put game disk in Drive 1.
	;** copy "autoboot-BAS.DSK" to main folder C:\GameBase\Tatung Einstein\

	;.XBS game files need to loaded manually.
	; using sendkeys for the LOAD and waiting before RUN {enter} is possible, but very flakey.

	Add_CLP(einstein -nat -window -floppydisk1 "%dbpath%/autoboot-BAS.DSK" -floppydisk2 %gamepathfile% -skip_gameinfo -nowaitvsync)
	Run_Emulator_Send_Keys([10]drive 1{enter}[3]run "%run_value%"{ENTER}||80)

ElseIf Key_mode CONTAINS(basic1)
	; if the BASIC game is in multi-loading parts, the game disk will need to be in Drive 0, basic in Drive 1.
	;once emu has loaded type DRIVE 1 START (wait for BASIC to load). Drive 0.
	Add_CLP(einstein -nat -window -floppydisk1 %gamepathfile% -floppydisk2 "%dbpath%/autoboot-BAS1.DSK" -skip_gameinfo -nowaitvsync)
	Run_Emulator_Send_Keys([7]DRIVE 1{enter}[3]START{ENTER}||80)

ElseIf Key_mode CONTAINS(autocom)
	;This is for loading machine code games (.COM files) automatically.
	;*Only if the game is on a unprotected disk, they can be made auto boot.

	;boot with keyboard set to EMULATED mode (no -nat)
	Add_CLP(einstein -window -floppydisk1 %gamepathfile% -skip_gameinfo -nowaitvsync)
	Run_Emulator()

Else
	;you must type the filename to load and run the game (NATURAL enabled).
	Add_CLP(einstein -nat -window -floppydisk1 %gamepathfile% -skip_gameinfo -nowaitvsync)
	Run_Emulator_Send_Keys([7]%load_value%{ENTER}||80)
End If

